<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<%@include file="/WEB-INF/taglibs/common/taglibs.jsp"%>
<head>
<title><spring:message code="admin.orderfiltersnew.title" /></title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link rel="stylesheet" href="<c:url value="/css/styles.css"/>" />
<link rel="stylesheet"
	href="<c:url value="/javascripts/jscalendar/theme/calendar-system.css"/>" />
<script language="javascript"
	src="<c:url value="/javascripts/common.js"/>"></script>
<script src="<c:url value="/javascripts/jscalendar/calendar-cfg.js"/>"></script>
<script src="<c:url value="/javascripts/calendar.js"/>"></script>
<script
	src="<c:url value="/javascripts/jscalendar/lang/calendar-en.js"/>"></script>
<script src="<c:url value="/javascripts/jscalendar/calendar-setup.js"/>"></script>
<script language="javascript">
	var functionName="";
	 function validateForm(){
		 if(functionName=="cancel")return true;
		 return (validate_required(document.getElementById("title"),'Please enter filter title.'));
	 }
</script>
</head>

<body><%@include file="../top_menu.jsp"%>
<table width="100%">
	<tr>
		<td><c:import url="/WEB-INF/jsp/menu/view_orders_menu.jsp" />
		</td>
	</tr>
	<tr>
		<td><%@include file="/WEB-INF/jsp/include/messages.jsp"%>
		<br />
		</td>
	</tr>
</table>
<table width=70%>
	<tr>
		<td class="pageHeading"><spring:message code="admin.orderfiltersnew.label.addnewfilter" /><br />
		</td>
	</tr>
 
</table>
<table width=70% class="formTable">

	<tr class="formHeader">
		<td><spring:message code="admin.orderfiltersnew.label.newfilterentryform" /></td>
	</tr>
	<tr>
		<td valign="top"><form:form commandName="newFilterForm"
			action="view_orders_filters.htm" method="post"
			onsubmit="return validateForm()">
			<table border="0" cellpadding="4" cellspacing="1" width="100%">
				<tr>
					<td width="170"><spring:message code="admin.orderfiltersnew.label.serviceprovider" /><form:select
						path="providerConditionType">
						<form:options items="${conditionTypeList}" itemValue="ordinal"
							itemLabel="title" />
					</form:select>:</td>
					<td><form:hidden path="id" /> <form:select path="providerId" size="4">
						    <form:option value="0"><spring:message code="admin.orderfiltersnew.label.any" /></form:option>
						    <form:options items="${providerList.pageItems}" itemValue="id" itemLabel="fullName" />
					    </form:select></td>
				</tr>
				<tr>
					<td width="170"><spring:message code="admin.orderfiltersnew.label.datefrom" />:</td>
					<td><component:calendar bindPath="dateFrom" /><form:hidden path="dateFromConditionType"/></td>
				</tr>
				<tr>
					<td width="170"><spring:message code="admin.orderfiltersnew.label.dateto" />:</td>
					<td><component:calendar bindPath="dateTo" /><form:hidden path="dateToConditionType"/></td>
				</tr>
				<tr>
					<td width="170"><spring:message code="admin.orderfiltersnew.label.orderstatus" /><form:select
						path="statusConditionType">
						<form:options items="${conditionTypeList}" itemValue="ordinal"
							itemLabel="title" />
					</form:select>:</td>
					<td><form:select path="statusId" size="4">
						<form:option value="0"><spring:message code="admin.orderfiltersnew.label.any" /></form:option>
						<form:options items="${statusList}" itemValue="id"
							itemLabel="name" />
					</form:select></td>
				</tr>
				<tr>
					<td width="170"><spring:message code="admin.orderfiltersnew.label.title" />:</td>
					<td colspan="2"><form:input path="title" size="24" /></td>
				</tr>
				<tr>
					<td width="170"><spring:message code="admin.orderfiltersnew.label.active" /></td>
					<td colspan="2"><form:checkbox path="active" /></td>
				</tr>
				<tr>
					<td colspan="2" class="buttonPanel"><c:choose>
						<c:when test="${empty param.edit}">
							<button name="add" type="submit" class='ui-button ui-state-default ui-corner-all' onclick="functionName=add;"><spring:message code="admin.orderfiltersnew.button.addfilter" /></button>
						</c:when>
						<c:otherwise>
							<button name="add" type="submit" class='ui-button ui-state-default ui-corner-all' onclick="functionName=save;"><spring:message code="admin.orderfiltersnew.button.savefilter" /></button>
						</c:otherwise>
					</c:choose>
					<button name="cancel_add" type="submit" class='ui-button ui-state-default ui-corner-all'
						onclick="functionName=cancel;"><spring:message code="admin.orderfiltersnew.button.cancel" /></button>
					</td>
				</tr>
			</table>
		</form:form></td>
	</tr>
</table>
<%@include file="/WEB-INF/jsp/include/footer.jsp"%>
</body>
</html>
